package com.lsh.dao;

import com.lsh.pojo.OrderSetting;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface OrderSettingDao {
    OrderSetting findByOrderDate(Date orderDate);
    @Update("update t_ordersetting set number = #{number} where orderDate = #{orderDate,jdbcType=DATE}")
    void updateNumber(OrderSetting orderSetting);
    @Insert("insert into t_ordersetting(orderDate,number,reservations) values(#{orderDate},#{number},0)")
    void add(OrderSetting orderSetting);
    @Select("select * from t_ordersetting where orderDate > #{dateBegin} and orderDate < #{dateEnd}")
    List<Map> getOrderSettingByMonth(@Param("dateBegin") String dateBegin, @Param("dateEnd") String dateEnd);
}
